<?php
$content = '';
if (isset($this->description['http://lod2.eu/schema/query'])) {    
    $querUri = $this->description['http://lod2.eu/schema/query'][0]['value'];
    $query = new OntoWiki_Resource($querUri, OntoWiki::getInstance()->selectedModel);
    $queryDesc = $query->getDescription();
    $queryDesc = $queryDesc[$querUri];
    if (isset($queryDesc['http://ns.ontowiki.net/SysOnt/sparql_code'])) {
        $sparql = $queryDesc['http://ns.ontowiki.net/SysOnt/sparql_code'][0]['value'];
        $content = trim($this->querylist($sparql, 'lod2/item.phtml'));
    }
}
?>
<?php if ($content != "") :?>
<div class="maincontent">
    <div class="section">
        <h3><?php echo $query->getTitle() ?></h3>
        <!-- ul -->
        <?php echo $content ?>
        <!-- /ul -->
    </div>
</div>
<?php endif; ?>
